package com.lzg.extend;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * 注：@SerializedName只在gson解析时使用，
 *     Jackson解析中无效。
 */
public class SimpleBaseResponse implements Serializable {

    private static final long serialVersionUID = -1477609349345966116L;

    @SerializedName(value = "code", alternate = {"msgcode", "msgCode", "ret"})
    private int code;
    @SerializedName(value = "msg", alternate = {"info"})
    private String msg;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public BaseResponse toBaseResponse() {
        BaseResponse lzyResponse = new BaseResponse();
        lzyResponse.setCode(code);
        lzyResponse.setMsg(msg);
        return lzyResponse;
    }
}
